//
//  SLUserDelegateViewController.m
//  StarLight
//
//  Created by Duke.wu on 16/6/6.
//  Copyright © 2016年 Duke.Wu. All rights reserved.
//

#import "SLUserDelegateViewController.h"

@interface SLUserDelegateViewController ()

@end

@implementation SLUserDelegateViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  self.title = @"用户协议";
  self.view.backgroundColor = [UIColor defeutBackgroudColor];
  UIScrollView *mainScroll = [UIScrollView new];
  UIView *contentView = [UIView new];
  
  [self.view addSubview:mainScroll];
  [mainScroll addSubview:contentView];
  [mainScroll mas_makeConstraints:^(MASConstraintMaker *make) {
    make.edges.equalTo(self.view);
  }];
  
  [contentView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.edges.equalTo(mainScroll);
    make.width.equalTo(mainScroll);
  }];
  
  
  UILabel *cotentLabel = [UILabel labelWithFontSize:14 textColor:[UIColor blackColor]];
  cotentLabel.numberOfLines = 0;
  [contentView addSubview:cotentLabel];
  NSString *path = [[NSBundle mainBundle] pathForResource:@"UserDelegate" ofType:@"txt"];
  NSString *content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
  cotentLabel.text = content;
  
  [cotentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
    make.top.equalTo(contentView).offset(10);
    make.width.equalTo(self.view).offset(-3);
    make.centerX.equalTo(self.view);
  }];
  
  [contentView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.bottom.equalTo(cotentLabel).offset(20);
  }];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
